<template>
  <view class="">
    <!-- <view class="uni-page-head" v-if="titleFlag">
      <image class="common-title-img" style="left: 20rpx;"
             :src="require('../../static/imges/fanhui.png')" @click="back()"></image>
      <view class="uni-page-head-title">
        物资明细
      </view>
    </view>
    <view v-if="titleFlag" style="margin-top: 98rpx;" /> -->
    <!-- <view style="width: 100%; margin-top: 10px;" v-for="(item,index) in dataList" :key="index"> -->
      <view class="common-body-ex">
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">资源资产编码 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.sourceAssetCode }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">标签ID :</label>
          <text class="common-list-text-ex-patch">{{ materialData.labelId }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">退库状态 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.retreatStatusName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">创建时间 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.createTime }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">是否扫码确认 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.scanConfirmName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">扫码确认人 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.confirmUserName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">确认人角色 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.confirmUserRoleName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">扫码确认时间 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.confirmTime }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">赋码贴签方式 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.fromPhotoName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">创建人姓名 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.createUserName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">数量 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.amount }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">物资分类 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.catTypePmsName }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">扫码地址 :</label>
          <text class="common-list-text-ex-patch">{{ materialData.address }}</text>
        </view>
        <view class="common-list-ex-patch">
          <label class="common-list-title-ex">退库单ID :</label>
          <text class="common-list-text-ex-patch">{{ materialData.retreatdetailid }}</text>
        </view>
      </view>
    <!-- </view> -->


  </view>
</template>

<script>
export default {
  data() {
    return {
      dataList: [
        {
          osTime :'11111111111111111'
        }
      ],
      materialData: {},
      prjId: '',
      titleFlag: true,
    }
  },
  onLoad(option) {
    this.prjId = option.prjId
    //判断新老MOA用来显示导航栏
    if (uni.getStorageSync('moaType') == "0") {
      this.titleFlag = false
    }
    this.materialData = JSON.parse(decodeURIComponent(option.materialData))
    // this.getList();
  },
  methods: {
    back() {

      uni.navigateBack({
        delta: 1
      });
    },

    getList() {
      uni.showLoading({
        title: '加载中...',
        mask: true
      });

      console.log('传入参数' + this.prjId);

      uni.request({
        // url: uni.getStorageSync('url') + "/pms/app/equip/queryOsEquipList?prjId=" + this.prjId+
        // "&applyId="+this.applyId+"&categoryCode="+this.categoryCode+"&categoryName="+""+"&dwjl="+this.dwjl+"&recipientApplyId="+""+"&orderId="+"",
        url: uni.getStorageSync("PMS20url") + "/api/app/equip/queryOsEquipList",

        method: 'POST',
        dataType: 'json',
        timeout: 10000 * 60,
        header: {
          "sysToken": uni.getStorageSync("PMStoken"),
        },
        data: {
          prjId: this.prjId,
        },
        success: (res) => {
          uni.hideLoading();
          //console.log('列表数据:' + JSON.stringify(res));

          var data = res.data;
          var result = JSON.stringify(data)
          console.log('出库单数据:' + result);
          if (data.code == "200") {
            this.dataList = data.data
          } else {
            uni.showModal({
              title: '温馨提示',
              content: data.message,
              showCancel: false,
              confirmColor: '#eb4b4b',
            })
          }

          uni.hideLoading();
          uni.stopPullDownRefresh();

        },
        fail: (data, code) => {
          uni.hideLoading();
          uni.stopPullDownRefresh();
          console.log('fail' + JSON.stringify(data));
        }
      });
    },


  }
}
</script>


<style>
@import '@/common/common-ui.css';
</style>
